#ifndef STATELISTENER_H
#define STATELISTENER_H


#include <string>


class State;


/*

class StateListener
{
    public:
        StateListener(){};
        virtual ~StateListener(){};



    virtual void manageState(std::string stateName, State* state)=0;

	virtual State*	    findByName(std::string stateName) = 0;
	virtual void		changeState(State *state) = 0;
	virtual bool		pushState(State* state) = 0;
	virtual void		popState() = 0;
	virtual void		pauseState() = 0;
    virtual void        popAllAndPushState(State* state) = 0;



    protected:
    private:
};
*/

class StateManager;

class State
{
public:
	static void create(StateManager* parent, const std::string name){};

	void destroy(){delete this;}

	virtual void enter() = 0;
	virtual void exit() = 0;
	virtual bool pause(){return true;}
	virtual void resume(){};
	virtual void update(double timeSinceLastFrame) = 0;

	void setParent(StateManager* _parent){m_pParent=_parent;};


protected:
	State(){};

//	State*	    findByName(std::string stateName){return m_pParent->findByName(stateName);};


	void		changeState(State* state);
	bool		pushState(State* state);
	void		popState();
    void        popAllAndPushState(State* state);

	StateManager*	m_pParent;

};



#endif // STATELISTENER_H
